package org.hegang.design.second.absfactory;

public class ShapeFactory extends AbstractFactory {

    @Override
    public Shape getShape(String shape) {
        if ("Circle".equalsIgnoreCase(shape)) {
            return new Circle();
        } else if ("Square".equalsIgnoreCase(shape)) {
            return new Square();
        } else if ("Rectangle".equalsIgnoreCase(shape)) {
            return new Rectangle();
        } else {
            throw new IllegalArgumentException("参数异常");
        }
    }

    @Override
    public Color getColor(String color) {
        return null;
    }
}
